<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>电影评论</title>
    <%- include common %>
    <style>
        #carousel-example-generic,
        #carousel-example-generic .cimg {
            width: 100%;
            height: 300px;
        }
    </style>
</head>

<body>
    <%- include("head",{title:"mav",username}) %>
    <div class="container container-fluid">
        <div class="row">
            <div class="col-md-6">
                <h2 class="h2 text-danger">电影详情</h2>
                <div class="thumbnail">
                    <img style="height:320px;width:100%;" src="<%- result.images.large.replace(/img7/,'img3') %>"
                        class="" alt="">
                    <h4 class="text-primary pull-right"><%- result.year %></h4>
                    <h4 class="text-danger"><%- result.title %></h4>
                    <p class="text-success">评分: <%- result.rating.average %></p>
                    <p class="text-info">分类: <%- result.genres %></p>
                    <p class="text-warning">导演: <%- result.directors&&result.directors[0].name %></p>
                    <p class="text-warning">演员:
                        <%   result.casts.forEach(item=>{   %>
                        <span> <%- item.name %> </span>
                        <%   })  %>
                    </p>
                </div>
                <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
                    <!-- Indicators -->
                    <ol class="carousel-indicators">
                        <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                        <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                        <li data-target="#carousel-example-generic" data-slide-to="2"></li>
                    </ol>

                    <!-- Wrapper for slides -->
                    <div class="carousel-inner" role="listbox">
                        <%   result.casts.forEach((item,i)=>{   %>
                        <div class="<%- i==0?'item active':'item' %>">
                            <img class="cimg" src="<%- item.avatars.large.replace(/img7/,'img3') %>" alt="...">
                            <div class="carousel-caption"></div>
                        </div>
                        <%   })  %>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <h2 class="h2 text-success">电影评论</h2>
                <form action="<%- '/comment/submit?mid='+result.id  %>" method="POST">
                    <div class="form-group">
                        <label for="username">评论标题:</label>
                        <input type="text" class="form-control" name="title" id="username" placeholder="评论标题">
                    </div>
                    <div class="form-group">
                        <label for="username">评论内容:</label>
                        <textarea type="text" class="form-control" name="content" rows="10"
                            placeholder="评论内容"></textarea>
                    </div>
                    <button type="submit" class="btn btn-primary">提交评论</button>
                    <button type="reset" class="btn btn-danger">重置</button>
                </form>
            </div>
        </div>
    </div>
    <%- include foot %>

</body>

</html>